import React, { Component } from "react";
import { NavBar, Icon } from "antd-mobile";
import { withRouter } from "react-router-dom";
import "./pageNav.scss";

class PageNav extends Component {
  render() {
    return (
      <NavBar
        mode="light"
        icon={this.props.left ? <Icon type="left" /> : ""}
        onLeftClick={() => this.props.history.go(-1)}
      >
        {this.props.title}
      </NavBar>
    );
  }
}

export default withRouter(PageNav);
